<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html> 
<html lang="en"> 
<head>
	<% String path = request.getContextPath();%>
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>商城后台管理系统</title> 
    <link href="${pageContext.request.contextPath}/pages/css/base.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/pages/css/login/login.css" rel="stylesheet">
	<link rel="stylesheet" href="<%=path %>/js/themes/insdep/easyui.css"/>
	<link rel="stylesheet" href="<%=path %>/js/themes/insdep/easyui_animation.css"/>
	<link rel="stylesheet" href="<%=path %>/js/themes/insdep/easyui_plus.css">
	<script type="text/javascript" src="<%=path %>/js/jquery.min.js"></script>
	<script type="text/javascript" src="<%=path %>/js/jquery.easyui-1.5.1.min.js"></script>
	<script type="text/javascript" src="<%=path %>/js/themes/insdep/jquery.insdep-extend.min.js"></script>
</head> 
<body>
	<div class="login-hd">
                <img src="${pageContext.request.contextPath}/pages/images/main/shopLogo.png" alt="logo" width="25%"/>
        </div>
	</div>
	<div class="login-bd">
		<div class="bd-inner">
			<div class="inner-wrap">
				<div class="lg-zone">
					<div class="lg-box">
						<div class="lg-label"><h4>后台管理员登录</h4></div>
						<form  id="loginForm" >
							<div class="lg-username input-item clearfix">
								<i class="iconfont">&#xe60d;</i>
								<input id="username" name="username" type="text" placeholder="账号" value="">
							</div>
							<div class="lg-password input-item clearfix">
								<i class="iconfont">&#xe634;</i>
								<input id="password" name="password" type="password" placeholder="密码">
							</div>
							<div align="center" style="height: 30px ; color: red; font-size: medium;"><s:actionerror /><s:actionmessage /> </div>
							<div class="enter">
								<a  id="loginclick" class="purchaser" style="margin-left: 110px;" onclick="login()" >登录</a>
							</div>
						</form>
					</div>
				</div>
				<div class="lg-poster"></div>
			</div>
		</div>
	</div>
	<div class="login-ft">
		<div class="ft-inner">
			<div class="other-info">CopyRight© 商城管理</div>
		</div>
	</div>
</body> 
</html>

<script type="text/javascript">

	function login(){

		$.ajax({
			url:"<%=path%>/admin/loginu",
			type:"post",
			data:$("#loginForm").serialize(),
			dataType:"json",
			async:false,
			success:function(data){
				if(data.status == "20000"){
					$.messager.alert("success","登陆成功");
					window.location.href="/admin/main";
				}else if(data.status == "20001"){
					$.messager.alert("success","账号或密码错误");
				}
			},
			error:function(){
				$.messager.alert("error","登陆失败，请联系管理员");
			}
		})

	}

</script>
